package com.xci.platform.core;

import com.github.pagehelper.Page;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * Json表格
 */
@Data
public class JsonGrid implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 总记录数
     */
    private long total;

    /**
     * 数据集合
     */
    private List rows;

    /**
     * 是否成功
     */
    private boolean success;

    /**
     * 消息
     */
    private String msg;

    public JsonGrid(Page pageList) {
        this.success = true;
        this.total = pageList.getTotal();
        this.rows = pageList;
    }

    public JsonGrid(List list) {
        this.success = true;
        this.total = list.size();
        this.rows = list;
    }
    public JsonGrid(List list,Long total) {
        this.success = true;
        this.total = total;
        this.rows = list;
    }
}
